﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Ice.Toolkit.Utility
{
    public static class RandomHelper
    {
        public static List<int> Range(int min, int max, int count)
        {
            List<int> tmp = new List<int>(count);
            Random rand = new Random();
            int index = 0;

            while (true)
            {
                index++;

                var number = rand.Next(min, max);

                if (!tmp.Contains(number))
                {
                    tmp.Add(number);

                    if (tmp.Count == count) break;
                }
            }

            return tmp;
        }
    }
}
